package com.play.ballen.me.adapter

import android.widget.ImageView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.play.ballen.R
import com.play.ballen.interfaces.BottomSheetEntityContract

class BottomSheetDialogAdapter<T : BottomSheetEntityContract>(data: MutableList<T>) :
    BaseQuickAdapter<T, BaseViewHolder>(R.layout.item_team_percent, data) {

    var select: T? = null

    override fun convert(holder: BaseViewHolder, item: T) {
        //holder.setText(R.id.tvName, "$item%")
        holder.setText(R.id.tvName, item.getItemString())
        val imgCheck = holder.getView<ImageView>(R.id.imgCheck)
        if (item == select) {
            imgCheck.setImageResource(R.mipmap.ic_dialog_item_check)
        } else {
            imgCheck.setImageResource(0)
        }

    }

}